/**
 * Lenovo Group
 * Copyright (c) 1999-2016 All Rights Reserved.
 */
package com.lenovo.lmrp.api.appgateway;

import java.util.Map;

import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;

import com.lenovo.lmrp.api.model.RestResponse;
import com.lenovo.lmrp.api.model.view.ChangedTicketVO;

/**
 * Output client required web page
 * @author wujin
 * @version v1.0
 */
public interface IAppPage {
    /**
     * output html page to show ticket detail information
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/detailpage")
    @Produces("text/html; charset=UTF-8")
    public Response getTicketPage(@PathParam("itsmcode") String itsmcode,
                                  @PathParam("ticketid") String ticketid);
    
    /**
     * output html page to show ticket workflow page, user will do somthing in current activity node
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/processpage")
    @Produces("text/html; charset=UTF-8")
    public Response getProcessPage(@PathParam("itsmcode") String itsmcode,
                                   @PathParam("ticketid") String ticketid);
    
    /**
     * output html page for process one activity node, user should input somthing and submit form.
     * 
     * @param itsmcode
     * @param ticketid
     * @param activityid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/{activityid}/activepage")
    @Produces("text/html; charset=UTF-8")
    public Response getActivePage(@HeaderParam("Authorization") String token,
                                  @PathParam("itsmcode") String itsmcode,
                                  @PathParam("ticketid") String ticketid,
                                  @PathParam("activityid") String activityid);
    
    /**
     * 获取改约界面
     * 
     * @param itsmcode
     * @param ticketid
     * @param activityid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/{activityid}/changeAppoint")
    @Produces("text/html; charset=UTF-8")
    public Response getChangeAppointment(@PathParam("itsmcode") String itsmcode,
                                         @PathParam("ticketid") String ticketid,
                                         @PathParam("activityid") String activityid);
    /**
     * 获取设备信息录入页面
     * 
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/deviceInput")
    @Produces("text/html; charset=UTF-8")
    public Response getDeviceInputPage(@PathParam("itsmcode") String itsmcode,@QueryParam("picker") String picker);
    /**
     * 获取设备信息页面
     * 
     * @param data
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/deviceInfo")
    @Produces("text/html; charset=UTF-8")
    public Response getDeviceInfoPage(@PathParam("itsmcode") String itsmcode,
                                      @QueryParam("attId") String id,
                                      @QueryParam("name") String name,
                                      @QueryParam("id") String partNo,
                                      @QueryParam("fru") String fruNo,
                                      @QueryParam("description") String desc);
    /**
     * 快速关单页面
     * @param itsmcode
     * @param ticketid
     * @return
     */
	@GET
	@Path("/{itsmcode}/tickets/{ticketid}/breakoff")
	@Produces("text/html;charset=UTF-8")
	public Response getBreakOffPage(@PathParam("itsmcode") String itsmcode,
	                                @PathParam("ticketid") String ticketid);
    /**
      * 获取退单页面
      * @param itsmcode
      * @param ticketid
      * @return
      */
     @GET
     @Path("/{itsmcode}/tickets/{ticketid}/backOrder")
     @Produces("text/html; charset=UTF-8")
     public Response getBackOrderInfoPage(@PathParam("itsmcode") String itsmcode,
             							  @PathParam("ticketid") String ticketid);
     

     /**
      * 获取创建巡检单页面
      * @param itsmcode
      * @param ticketid
      * @param activityid
      * @return
      */
     @GET
     @Path("/{itsmcode}/tickets/inspectionTicket")
     @Produces("text/html; charset=UTF-8")
     public Response getCreateTicketPage(@PathParam("itsmcode") String itsmcode);


 	/**
      * 获取巡检单详情页面
      * 
      * @param itsmcode
      * @param ticketid
      * @return
      */
     @GET
     @Path("/{itsmcode}/tickets/{ticketid}/inspectiondetailpage")
     @Produces("text/html; charset=UTF-8")
     public Response getInspectionTicketPage(@PathParam("itsmcode") String itsmcode,
                                   @PathParam("ticketid") String ticketid);
     
     
 	/**
      * 获取已关单工单详情页面
      * 
      * @param itsmcode
      * @param ticketid
      * @return
      */
     @GET
     @Path("/{itsmcode}/tickets/{ticketid}/closeddetailpage")
     @Produces("text/html; charset=UTF-8")
     public Response getClosedTicketPage(@PathParam("itsmcode") String itsmcode,
                                   @PathParam("ticketid") String ticketid);
    
    /**
     * 获取工单详情设备信息和设备图片页面
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/ticketparts")
    @Produces("text/html; charset=UTF-8")
    public Response getTicketParts(@PathParam("itsmcode") String itsmcode, 
                                 @PathParam("ticketid") String ticketid,
                                 @QueryParam("id") String id);
    /**
     * 获取工单详情附件信息页面
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/attachmentInfo")
    @Produces("text/html; charset=UTF-8")
    public Response getAttachmentInfo(@PathParam("itsmcode") String itsmcode, 
                                 @PathParam("ticketid") String ticketid);
    
    /**
     * 获取上传附件页面
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/uploadPage")
    @Produces("text/html; charset=UTF-8")
    public Response getUploadPage(@PathParam("itsmcode") String itsmcode, 
                                 @PathParam("ticketid") String ticketid);
    /**
     * 获取关于页面
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/about")
    @Produces("text/html; charset=UTF-8")
    public Response getAboutPage(@PathParam("itsmcode") String itsmcode);
    
    /**
     * 获取项目组信息页面
     * @author zx-lxj
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/projectPage")
    @Produces("text/html; charset=UTF-8")
    public Response getProjectPage(@PathParam("itsmcode") String itsmcode, 
                                 @PathParam("ticketid") String ticketid);
    
    /**
     * 获取工单详情解决方案页面
     * 
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/solution")
    @Produces("text/html; charset=UTF-8")
    public Response getSolution(@PathParam("itsmcode") String itsmcode, 
                                 @PathParam("ticketid") String ticketid);
    
    /**
     * get one special ticket parts by partnum
     * 
     * @param itsmCode
     * @param ticketid
     * @param partnum
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/parts/{partnum}")
    public Response getParts(@PathParam("itsmcode") String itsmCode,
        @PathParam("ticketid") String ticketid,
        @PathParam("partnum") String partnum);
    
    
    /**
     * 创建巡检单，跳转到上传巡检设备页面
     * 
     * @param itsmcode
     * @param ticket
     * @return
     */
    @POST
    @Path("/{itsmcode}/tickets/createInspectionTicket")
    public RestResponse<String> createInspectionTicket(@PathParam("itsmcode") String itsmcode,
                                           Map<String, String> fields);
    /**
     * 跳转上传巡检设备信息页面
     * @author zx-lxj
     * @param itsmcode
     * @param ticketid
     * @return
     */
    @GET
    @Path("/{itsmcode}/tickets/{ticketid}/uploadDevice")
    @Produces("text/html; charset=UTF-8")
    public Response getUploadDevicePage(@PathParam("itsmcode") String itsmcode, 
                                 @PathParam("ticketid") String ticketid);
    
    /**
     * 保存巡检单设备信息
     * @author zx-lxj
     * @param itsmcode
     * @param ticketid
     * @param ticket
     * @return
     */
    @POST
    @Path("/{itsmcode}/tickets/{ticketid}/saveParts")
    public RestResponse<String> saveParts(@PathParam("itsmcode") String itsmcode,
                                              @PathParam("ticketid") String ticketid,
                                              ChangedTicketVO changedVO); 

} 
